package com.fxd.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther fuxudong
 * @date 2021/5/2 - 21:47
 */
@RestController
//需要刷新一下post请求才能生效
//curl -X POST "http://localhost:3344/actuator/bus-refresh"
@RefreshScope
public class ConfigClientController {

    @Value("${server.port}")
    private String serverPort;

    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/configInfo")
    public String getConfigInfo() {
        return configInfo+" port: "+serverPort;
    }
}
